<script type="text/javascript" src="js/pizza-builder.js"></script>
{if $smarty.get.id eq ""}
<h1>{$lang.specials_title}</h1>
{foreach from=$pizzas item=specials}
<div  class="item-block">
  <div class="image">
    <a href="index.php?act=specials&id={$specials.id}" title="{$specials.name}" > 
      {if  $specials.image == ""}
      <img src="images/no_image.gif" style="border:none"> 
      {else}
      <img src="UserFiles/Image/product_photos/{$specials.image}" style="border:none"> 
      {/if}
    </a>
  </div> {*image*}
       
  <div class="desc">
    <a href="index.php?act=specials&id={$specials.id}"  title="{$specials.name}" >{$specials.name|stripslashes}</a>
    <b>
      <a href="index.php?act=specials&id={$specials.id}"  title="{$specials.name}"  style="margin-left:10px" >
    {$specials.price|price_format}
      </a>
    </b>
  </div> {*desc*}

</div>{*item-block*}

{/foreach}

{else}

<form id="pizzaform" method="post">
  <div id="pizza-builder">
  
  <div style="padding-bottom:15px">  <h1>{$pizzas.0.name|stripslashes}</h1>
<p>{$lang.specials_description} {$pizzas.0.description|stripslashes}</p></div>
       <img src="UserFiles/Image/product_photos/{$pizzas.0.image}" style="border:none"> 
    <table width="100%" border="0" cellspacing="3" cellpadding="3">
  <tr>
    <td width="150"><label>{$lang.pizzabuilder_quantity_label}</label></td>
    <td> <input type="text" name="quantity" value="1" size="5"></td>
  </tr>
    {if $who_for eq 1}
  <tr>
    <td> <label>{$lang.pizzabuilder_who_question}</label></td>
    <td><input type="text" name="forwho" ></td>
  </tr>
      {/if}
</table>

   
 </div>
 
  
 <!-- start pizza items--> 
 <div id="pizza-items">
  
     {literal}           
 <SCRIPT type=text/javascript>
	$(function() {
		$("#pizza-tabs-titles").tabs();
		$(".pizza-tabs").tabs();
	});
	</SCRIPT>
  {/literal}
  
  <div id="pizza-tabs-titles" >
<ul>
    {foreach from=$pizzas.0.pizzas item=specials}
  	<li><a href="#pizza-tabs-titles-{$specials.id}">{$specials.name|stripslashes}</a> </li>
  	{/foreach}
   </ul>   
     {foreach from=$pizzas.0.pizzas item=pizza}
  <div id="pizza-tabs-titles-{$pizza.id}">

    
    <!--start toppings-->
    
      <p><strong>{$lang.specials_choose_toppings}</strong></p>
      <table width="100%" border="0" cellspacing="5" cellpadding="5">
            <tr>
              <td width="150"></td>
              {if $pizza.sides.0 eq 1}
              <td style="text-align:center"><img src="images/none.jpg" /><br />
                None</td>
              {/if}
              {if $pizza.sides.1 eq 1}
              <td  style="text-align:center"><img src="images/left.jpg" /><br />
                Left</td>
              {/if}
              {if $pizza.sides.2 eq 1}
              <td  style="text-align:center"><img src="images/whole.jpg" /><br />
                Whole</td>
              {/if}
              {if $pizza.sides.3 eq 1}
              <td  style="text-align:center"><img src="images/right.jpg" /><br />
                Right</td>
              {/if} </tr>
            {foreach from=$pizza.toppings item=veg}
            <tr>
              <td width="200"> {assign var=vege value=":"|explode:$veg} 
            
          {$vege.0}{if $vege.1 ne ""}<span style="color:green"> <em>(+{$vege.1|price_format})</em></span>{/if} </td>
              {foreach from=$pizza.sides item=sides key=k}
              {if $sides eq 1}
              
              {if $k eq 0 and $sides eq 1}
              {assign value="None" var="side"}
              
              {elseif $k eq 1 and $sides eq 1}
              
              {assign value="Left"  var="side"}
              {elseif $k eq 2 and $sides eq 1}
              
              {assign value="Whole"  var="side"}
              {elseif $k eq 3 and $sides eq 1}
              
              {assign value="Right"  var="side"}
              {/if}
              
              <td style="text-align:center">
       
              <input class="calc{if $k ne 0} topping{/if}" type="radio" name="topping[{$veg}]"  {if $k eq 0} checked="checked" value=""  {else} value="{$veg} {$side} Side|{$side}" {/if}>
              
              </td>
              {/if}
              {/foreach} 
              
              {/foreach} </tr>
          </table>
    <!-- end toppings-->
   
   
   {if $pizza.base.0 ne ""}
   <!-- start base-->
        <p><strong>Choose your base bread</strong></p>
          <table width="100%" border="0" cellspacing="5" cellpadding="5">
            {foreach from=$pizza.base item=veg key=k}
            <tr>
              <td width="100"> {assign var=vege value=":"|explode:$veg} 
            
          {$vege.0}{if $vege.1 ne ""}<span style="color:green"> <em>(+{$vege.1|price_format})</em></span>{/if}</td>
              <td style="text-align:center"><input class="calc" type="radio" name="base" value="{$veg}"  {if $k eq 0} checked="checked"  {/if} ></td>
              {/foreach} </tr>
          </table>
    <!-- end base-->
    {/if}
    
    
       {if $pizza.sauce.0 ne ""}
   <!-- start sauce-->
        <p><strong>Choose your sauce</strong></p>
          <table width="100%" border="0" cellspacing="5" cellpadding="5">
            {foreach from=$pizza.sauce item=veg key=j}
            <tr>
              <td width="100"> {assign var=vege value=":"|explode:$veg} 
            
          {$vege.0}{if $vege.1 ne ""}<span style="color:green"> <em>(+{$vege.1|price_format})</em></span>{/if}</td>
              <td style="text-align:center"><input class="calc" type="radio" name="base" value="{$veg}"  {if $j eq 0} checked="checked"  {/if} ></td>
              {/foreach} </tr>
          </table>
    <!-- end sauce-->
    {/if}
    
  </div>
  	{/foreach}
    

  </div> 
  <!-- end pizza items-->
  
  
  <div class="pizza-sizes">
    <div>
      <label>Add any additional instructions here. Do not use for ordering items or toppings.</label>
      <textarea name="instructions" style="width:340px;height:60px"></textarea>
    </div>
    <div style="text-align:right;font-size:1.2em;margin-top:25px;">
      <label &nbsp;></label>
      Total price per pizza: <span id="pizza_price">{$pizzas.0.price|price_format}</span> <span class="button"><a href="" class="add-pizza">Add to Order</a></span></div>
    <div></div>
  </div>
</form>



{/if}
